package com.java.eyes.sample;

import com.java.eyes.processors.ImageProcessor;
import com.java.eyes.processors.SimpleImageProcessor;
import com.java.eyes.ui.SimpleView;

public class HelloWorld {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		String imageProcessorClassName = "com.java.eyes.processors.SimpleImageProcessor";
		String imageFilename = "junk.gif";

		if (args.length == 0) {
		} else if (args.length == 1) {
			imageProcessorClassName = args[0];
		} else if (args.length == 2) {
			imageProcessorClassName = args[0];
			imageFilename = args[1];
		} else {
			System.out.println("Invalid args");
			System.exit(1);
		}
		
		ImageProcessor imageProcessor = null;
		try {
			imageProcessor = (ImageProcessor) Class.forName(
					imageProcessorClassName).newInstance();
		}catch(Exception e)
		{
			System.out.println(e);
		}

		// Display name of processing program and
		// image file.
		System.out.println("Opening Image file "+imageFilename+" with Processors: " + imageProcessorClassName);

		SimpleView obj = new SimpleView(imageFilename, imageProcessor);
	}
}
